let audio = new Audio();
// audio.ontimeupdate = () =>{
//     console.log(audio.currentTime)
// }
//歌曲播放完后跳到下一曲播放
audio.onended = function(){
    let songsLength = this.$vm.$store.state.datas.length;
    let id;
    if(this.$vm.$store.state.index < songsLength-1){
        this.$vm.$store.state.index += 1;
        id = this.$vm.$store.state.datas[this.$vm.$store.state.index].id
        // 获取歌曲url
        this.musicUrl = "https://music.163.com/song/media/outer/url?id="+id
        this.src = this.musicUrl
        this.play()
    }else{
        this.$vm.$store.state.index = 0;
        id = this.$vm.$store.state.datas[this.$vm.$store.state.index].id
        // 获取歌曲url
        this.musicUrl = "https://music.163.com/song/media/outer/url?id="+id
        this.src = this.musicUrl
        this.play()
    }
}

export default audio